import service from './request'

export function banner(data) {
    return service({
        url: "/api/v1/banner/find",
        method: 'post',
        data
    })
}

export function register(data) {
    return service({
        url: "/api/v1/user/register",
        method: 'post',
        data
    })
}


export function login(data) {
    return service({
        url: "/api/v1/user/login",
        method: 'post',
        data
    })
}

export function menu(data) {
    return service({
        url: "/api/v1/menu/find",
        method: 'post',
        data
    })
}
export function articleCateglory(data) {
    return service({
        url: "/api/v1/article/categlory/find",
        method: 'post',
        data
    })
}

export function productcateglory(data) {
    return service({
        url: `/api/v1/find/product/categlory/by/example`,
        method: 'post',
        data
    })
}


export function productFind(data) {
    return service({
        url: `/api/v1/product/find`,
        method: 'post',
        data
    })
}

export function productDetail(data) {
    return service({
        url: `/api/v1/product/get/by/id`,
        method: 'post',
        data
    })
}

export function productDetailPic(data) {
    return service({
        url: `/api/v1/product/detail/get/by/id`,
        method: 'post',
        data
    })
}
export function articlExample(data) {
    return service({
        url: `/api/v1/find/article/by/example`,
        method: 'post',
        data
    })
}
export function articlDetail(data) {
    return service({
        url: `/api/v1/article/get/by/id`,
        method: 'post',
        data
    })
}


export function adviceAdd(data) {
    return service({
        url: `/api/v1/advice/add`,
        method: 'post',
        data
    })
}

export function multipartFiler(data) {
    return service({
        url: `/api/v1/multipartFile/find`,
        method: 'post',
        data
    })
}
export function companyInfo(data) {
    return service({
        url: `/api/v1/contact/get/latest`,
        method: 'get',
        data
    })
}
export function addCart(data) {
    return service({
        url: `/api/v1/cart/add`,
        method: 'post',
        data
    })
}
export function cartList(data) {
    return service({
        url: `/api/v1/cart/product/find/by/uid`,
        method: 'post',
        data
    })
}
export function deleteCart(data) {
    return service({
        url: `/api/v1/cart/product/delete`,
        method: 'post',
        data
    })
}
export function cartNumplus(data) {
    return service({
        url: `/api/v1/cart/num/plus`,
        method: 'post',
        data
    })
}
export function buyNow(data) {
    return service({
        url: `/api/v1/cart/buy/now`,
        method: 'post',
        data
    })
}

export function orderList(data) {
    return service({
        url: `/api/v1/order/find`,
        method: 'post',
        data
    })
}
export function orderAdd(data) {
    return service({
        url: `/api/v1/order/add`,
        method: 'post',
        data
    })
}
export function unifiedorder(data) {
    return service({
        url: `/api/v1/order/pay/unifiedorder`,
        method: 'post',
        data
    })
}
export function addressAdd(data) {
    return service({
        url: `/api/v1/address/add`,
        method: 'post',
        data
    })
}

export function addressList(data) {
    return service({
        url: `/api/v1/address/get/by/uid`,
        method: 'post',
        data
    })
}

export function setDefault(data) {
    return service({
        url: `/api/v1/address/setDefault`,
        method: 'post',
        data
    })
}
export function statusPay(data) {
    return service({
        url: `/api/v1/find/order/pay/status`,
        method: 'post',
        data
    })
}
export function returnMoney(data) {
    return service({
        url: `/api/v1/order/apply/refund`,
        method: 'post',
        data
    })
}
export function openIdGet(params) {
    return service({
        url: `/api/v1/order/get/wx/openId`,
        method: 'get',
        params
    })
}
export function prepay(data) {
    return service({
        url: `/api/v1/order/wx/prepay`,
        method: 'post',
        data
    })
}

export function addressdDelete(data) {
    return service({
        url: `/api/v1/address/delete/by/id`,
        method: 'post',
        data
    })
}
export function addressupdate(data) {
    return service({
        url: `/api/v1/address/update`,
        method: 'post',
        data
    })
}
export function aliunifiedorder(data) {
    return service({
        url: `/api/v1/order/alipay/unifiedorder`,
        method: 'post',
        data
    })
}
export function bindingWeixin(data) {
    return service({
        url: `/api/v1/user/wx/binding`,
        method: 'post',
        data
    })
}
export function openidgetinfo(data) {
    return service({
        url: `/api/v1/user/get/by/openid`,
        method: 'post',
        data,
    })
}
// /api/v1/order/alipay/createOrder
export function createOrderAlipay(data) {
    return service({
        url: `/api/v1/order/alipay/createOrder`,
        method: 'post',
        data,
    })
}